package cliente.gui;
import java.awt.event.ActionListener;
import javax.swing.JFrame;
import javax.swing.table.DefaultTableModel;

import org.freixas.jcalendar.JCalendarCombo;

import servidor.dominio.*;

//import org.jpox.sco.Vector;
import comun.dto.*;

import java.util.Vector;


import java.awt.FlowLayout;
import java.util.Date;

public class GUIAltaEmpleado extends JFrame{

	 /** Creates new form GUIAltaEmpleado */
    public GUIAltaEmpleado() {
        initComponents();
        this.setLocationRelativeTo(null);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">
    private void initComponents() {
    	  datos = new javax.swing.JTabbedPane();
          datosPersonlaes = new javax.swing.JTabbedPane();
          jLayeredPane1 = new javax.swing.JLayeredPane();
          aceptar = new javax.swing.JButton();
          cancelar = new javax.swing.JButton();
          jLabel1 = new javax.swing.JLabel();
          jLabel2 = new javax.swing.JLabel();
          jLabel3 = new javax.swing.JLabel();
          jLabel4 = new javax.swing.JLabel();
          jLabel5 = new javax.swing.JLabel();
          nombre = new javax.swing.JTextField();
          apellido = new javax.swing.JTextField();
          cuil = new javax.swing.JTextField();
          jLabel6 = new javax.swing.JLabel();
          cuitEmpresa = new javax.swing.JTextField();
          calendario = new org.freixas.jcalendar.JCalendarCombo();
          categoria = new javax.swing.JComboBox();
          conceptos = new javax.swing.JTabbedPane();
          jPanel1 = new javax.swing.JPanel();
          jLabel7 = new javax.swing.JLabel();
          jScrollPane1 = new javax.swing.JScrollPane();
          tablaConceptos = new javax.swing.JTable();
          conbConceptos = new javax.swing.JComboBox();
          agregarConcepto = new javax.swing.JButton();
          jPanel3 = new javax.swing.JPanel();
          jLabel8 = new javax.swing.JLabel();
          nroDeCuenta = new javax.swing.JTextField();
          jLabel9 = new javax.swing.JLabel();
          nroSucursal = new javax.swing.JTextField();
          jLabel10 = new javax.swing.JLabel();
          banco = new javax.swing.JTextField();
          eliminar = new javax.swing.JButton();

          setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
          setTitle("Alta de Empleado");
         

          aceptar.setText("Acpetar");
          aceptar.setBounds(110, 260, 80, 23);
          jLayeredPane1.add(aceptar, javax.swing.JLayeredPane.DEFAULT_LAYER);

          cancelar.setText("Cancelar");
          cancelar.setBounds(210, 260, 90, 23);
          jLayeredPane1.add(cancelar, javax.swing.JLayeredPane.DEFAULT_LAYER);

          jLabel1.setText("Nombre: ");
          jLabel1.setBounds(10, 30, 70, 14);
          jLayeredPane1.add(jLabel1, javax.swing.JLayeredPane.DEFAULT_LAYER);

          jLabel2.setText("Apellido: ");
          jLabel2.setBounds(10, 60, 70, 14);
          jLayeredPane1.add(jLabel2, javax.swing.JLayeredPane.DEFAULT_LAYER);

          jLabel3.setText("Cuil:");
          jLabel3.setBounds(10, 90, 40, 14);
          jLayeredPane1.add(jLabel3, javax.swing.JLayeredPane.DEFAULT_LAYER);

          jLabel4.setText("Fecha de Ingreso: ");
          jLabel4.setBounds(10, 170, 110, 14);
          jLayeredPane1.add(jLabel4, javax.swing.JLayeredPane.DEFAULT_LAYER);

          jLabel5.setText("Categoria:");
          jLabel5.setBounds(10, 210, 60, 14);
          jLayeredPane1.add(jLabel5, javax.swing.JLayeredPane.DEFAULT_LAYER);
          nombre.setBounds(60, 30, 250, 20);
          jLayeredPane1.add(nombre, javax.swing.JLayeredPane.DEFAULT_LAYER);
          apellido.setBounds(60, 60, 250, 20);
          jLayeredPane1.add(apellido, javax.swing.JLayeredPane.DEFAULT_LAYER);
          cuil.setBounds(60, 90, 250, 20);
          jLayeredPane1.add(cuil, javax.swing.JLayeredPane.DEFAULT_LAYER);

          jLabel6.setText("Cuit Empresa que Pertenece:");
          jLabel6.setBounds(10, 130, 170, 14);
          jLayeredPane1.add(jLabel6, javax.swing.JLayeredPane.DEFAULT_LAYER);
          cuitEmpresa.setBounds(180, 130, 130, 20);
          jLayeredPane1.add(cuitEmpresa, javax.swing.JLayeredPane.DEFAULT_LAYER);
          calendario.setBounds(110, 170, 200, 20);
          jLayeredPane1.add(calendario, javax.swing.JLayeredPane.DEFAULT_LAYER);

          categoria.setMaximumRowCount(100);
          categoria.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "" }));
          categoria.setSelectedIndex(-1);
          categoria.setBounds(110, 210, 200, 20);
          jLayeredPane1.add(categoria, javax.swing.JLayeredPane.DEFAULT_LAYER);

          datosPersonlaes.addTab("Empleado", jLayeredPane1);

          datos.addTab("Datos Personales", datosPersonlaes);

          jLabel7.setText("Seleccione los conceptos: ");

          tablaConceptos.setModel(new javax.swing.table.DefaultTableModel(
              new Object [][] {

              },
              new String [] {
                  "Descripcion", "Importe", "Porcentaje", "Remunerativo", "Tipo"
              }
          ) {
              Class[] types = new Class [] {
                  java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class
              };

              public Class getColumnClass(int columnIndex) {
                  return types [columnIndex];
              }
          });
          jScrollPane1.setViewportView(tablaConceptos);

          conbConceptos.setMaximumRowCount(100);
      

          agregarConcepto.setText("Agregar");

          jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("Datos Bancarios"));

          jLabel8.setText("Nro de Cuenta:");

      

          jLabel9.setText("Nro de Sucursal: ");

          jLabel10.setText("Banco:");

          javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
          jPanel3.setLayout(jPanel3Layout);
          jPanel3Layout.setHorizontalGroup(
              jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGroup(jPanel3Layout.createSequentialGroup()
                  .addContainerGap()
                  .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                      .addComponent(jLabel8)
                      .addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                      .addComponent(jLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE))
                  .addGap(10, 10, 10)
                  .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                      .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                          .addComponent(nroSucursal, javax.swing.GroupLayout.Alignment.TRAILING)
                          .addComponent(nroDeCuenta, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 181, Short.MAX_VALUE))
                      .addComponent(banco, javax.swing.GroupLayout.PREFERRED_SIZE, 181, javax.swing.GroupLayout.PREFERRED_SIZE))
                  .addGap(104, 104, 104))
          );
          jPanel3Layout.setVerticalGroup(
              jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGroup(jPanel3Layout.createSequentialGroup()
                  .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                      .addComponent(jLabel8)
                      .addComponent(nroDeCuenta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                  .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                      .addComponent(jLabel9)
                      .addComponent(nroSucursal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                  .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                      .addComponent(jLabel10)
                      .addComponent(banco, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                  .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
          );

          eliminar.setText("Eliminar");

          javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
          jPanel1.setLayout(jPanel1Layout);
          jPanel1Layout.setHorizontalGroup(
              jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGroup(jPanel1Layout.createSequentialGroup()
                  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                      .addGroup(jPanel1Layout.createSequentialGroup()
                          .addContainerGap()
                          .addComponent(eliminar, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE)
                          .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                          .addComponent(agregarConcepto, javax.swing.GroupLayout.PREFERRED_SIZE, 83, javax.swing.GroupLayout.PREFERRED_SIZE))
                      .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
                          .addContainerGap()
                          .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                              .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
                                  .addComponent(jLabel7)
                                  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                  .addComponent(conbConceptos, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                              .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 401, Short.MAX_VALUE))))
                  .addContainerGap(21, Short.MAX_VALUE))
              .addGroup(jPanel1Layout.createSequentialGroup()
                  .addContainerGap()
                  .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, 417, Short.MAX_VALUE)
                  .addGap(10, 10, 10))
          );
          jPanel1Layout.setVerticalGroup(
              jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGroup(jPanel1Layout.createSequentialGroup()
                  .addGap(42, 42, 42)
                  .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                  .addGap(18, 18, 18)
                  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                      .addComponent(conbConceptos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                      .addComponent(jLabel7))
                  .addGap(18, 18, 18)
                  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                      .addComponent(agregarConcepto)
                      .addComponent(eliminar))
                  .addGap(19, 19, 19)
                  .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
          );

          conceptos.addTab("Conceptos", jPanel1);

          datos.addTab("Conceptos", conceptos);

          javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
          getContentPane().setLayout(layout);
          layout.setHorizontalGroup(
              layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addComponent(datos, javax.swing.GroupLayout.PREFERRED_SIZE, 442, javax.swing.GroupLayout.PREFERRED_SIZE)
          );
          layout.setVerticalGroup(
              layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addComponent(datos, javax.swing.GroupLayout.DEFAULT_SIZE, 361, Short.MAX_VALUE)
          );

          pack();
    }// </editor-fold>
    

    
      // Variables declaration - do not modify
      private javax.swing.JButton aceptar;
      private javax.swing.JButton agregarConcepto;
      private javax.swing.JTextField apellido;
      private javax.swing.JTextField banco;
      private org.freixas.jcalendar.JCalendarCombo calendario;
      private javax.swing.JButton cancelar;
      private javax.swing.JComboBox categoria;
      private javax.swing.JComboBox conbConceptos;
      private javax.swing.JTabbedPane conceptos;
      private javax.swing.JButton eliminar;
      private javax.swing.JTextField cuil;
      private javax.swing.JTextField cuitEmpresa;
      private javax.swing.JTabbedPane datos;
      private javax.swing.JTabbedPane datosPersonlaes;
      private javax.swing.JLabel jLabel1;
      private javax.swing.JLabel jLabel10;
      private javax.swing.JLabel jLabel2;
      private javax.swing.JLabel jLabel3;
      private javax.swing.JLabel jLabel4;
      private javax.swing.JLabel jLabel5;
      private javax.swing.JLabel jLabel6;
      private javax.swing.JLabel jLabel7;
      private javax.swing.JLabel jLabel8;
      private javax.swing.JLabel jLabel9;
      private javax.swing.JLayeredPane jLayeredPane1;
      private javax.swing.JPanel jPanel1;
      private javax.swing.JPanel jPanel3;
      private javax.swing.JScrollPane jScrollPane1;
      private javax.swing.JTextField nombre;
      private javax.swing.JTextField nroDeCuenta;
      private javax.swing.JTextField nroSucursal;
      private javax.swing.JTable tablaConceptos;
      // End of variables declaration

      /**
       * @return the aceptar
       */
      public javax.swing.JButton getAceptar() {
          return aceptar;
      }
      
      /**
       * @return the eliminar
       */
      public javax.swing.JButton getEliminar() {
          return eliminar;
      }


      /**
       * @param aceptar the aceptar to set
       */
      public void setAceptar(javax.swing.JButton aceptar) {
          this.aceptar = aceptar;
      }

      /**
       * @return the apellido
       */
      public javax.swing.JTextField getApellido() {
          return apellido;
      }

      /**
       * @param apellido the apellido to set
       */
      public void setApellido(javax.swing.JTextField apellido) {
          this.apellido = apellido;
      }

      /**
       * @return the cancelar
       */
      public javax.swing.JButton getCancelar() {
          return cancelar;
      }

      /**
       * @param cancelar the cancelar to set
       */
      public void setCancelar(javax.swing.JButton cancelar) {
          this.cancelar = cancelar;
      }

      /**
       * @return the categoria
       */
      public javax.swing.JComboBox getCategoria() {
          return categoria;
      }

      /**
       * @param categoria the categoria to set
       */
      public void setCategoria(javax.swing.JComboBox categoria) {
          this.categoria = categoria;
      }

      /**
       * @return the cuil
       */
      public javax.swing.JTextField getCuil() {
          return cuil;
      }

      /**
       * @param cuil the cuil to set
       */
      public void setCuil(javax.swing.JTextField cuil) {
          this.cuil = cuil;
      }



      /**
       * @return the nombre
       */
      public javax.swing.JTextField getNombre() {
          return nombre;
      }

      /**
       * @param nombre the nombre to set
       */
      public void setNombre(javax.swing.JTextField nombre) {
          this.nombre = nombre;
      }

      /**
       * @return the agregarConcepto
       */
      public javax.swing.JButton getAgregarConcepto() {
          return agregarConcepto;
      }
      
      /**
       * @return the agregarNroDeCuenta
       */
     /* public javax.swing.JButton getAgregarNroDeCuenta() {
          return agregarNroDeCuenta;
      }*/

      /**
       * @param agregarConcepto the agregarConcepto to set
       */
      public void setAgregarConcepto(javax.swing.JButton agregarConcepto) {
          this.agregarConcepto = agregarConcepto;
      }

      /**
       * @return the agregarDatosBancarios
       */
      /*public javax.swing.JButton getAgregarDatosBancarios() {
          return agregarDatosBancarios;
      }*/

      /**
       * @param agregarDatosBancarios the agregarDatosBancarios to set
       */
      /*public void setAgregarDatosBancarios(javax.swing.JButton agregarDatosBancarios) {
          this.agregarDatosBancarios = agregarDatosBancarios;
      }*/

      /**
       * @return the banco
       */
      public javax.swing.JTextField getBanco() {
          return banco;
      }

      /**
       * @param banco the banco to set
       */
      public void setBanco(javax.swing.JTextField banco) {
          this.banco = banco;
      }

      /**
       * @return the conbConceptos
       */
      public javax.swing.JComboBox getConbConceptos() {
          return conbConceptos;
      }

      /**
       * @param conbConceptos the conbConceptos to set
       */
      public void setConbConceptos(javax.swing.JComboBox conbConceptos) {
          this.conbConceptos = conbConceptos;
      }

      /**
       * @return the conceptos
       */
      public javax.swing.JTabbedPane getConceptos() {
          return conceptos;
      }

      /**
       * @param conceptos the conceptos to set
       */
      public void setConceptos(javax.swing.JTabbedPane conceptos) {
          this.conceptos = conceptos;
      }

      /**
       * @return the cuitEmpresa
       */
      public javax.swing.JTextField getCuitEmpresa() {
          return cuitEmpresa;
      }

      /**
       * @param cuitEmpresa the cuitEmpresa to set
       */
      public void setCuitEmpresa(javax.swing.JTextField cuitEmpresa) {
          this.cuitEmpresa = cuitEmpresa;
      }

      /**
       * @return the datos
       */
      public javax.swing.JTabbedPane getDatos() {
          return datos;
      }

      /**
       * @param datos the datos to set
       */
      public void setDatos(javax.swing.JTabbedPane datos) {
          this.datos = datos;
      }

      /**
       * @return the datosBnacarios
       */
     /* public javax.swing.JTabbedPane getDatosBnacarios() {
          return datosBnacarios;
      }*/
      

      /**
       * @param datosBnacarios the datosBnacarios to set
       */
      /*public void setDatosBnacarios(javax.swing.JTabbedPane datosBnacarios) {
          this.datosBnacarios = datosBnacarios;
      }*/

      /**
       * @return the datosPersonlaes
       */
      public javax.swing.JTabbedPane getDatosPersonlaes() {
          return datosPersonlaes;
      }

      /**
       * @param datosPersonlaes the datosPersonlaes to set
       */
      public void setDatosPersonlaes(javax.swing.JTabbedPane datosPersonlaes) {
          this.datosPersonlaes = datosPersonlaes;
      }

      /**
       * @return the nroDeCuenta
       */
      public javax.swing.JTextField getNroDeCuenta() {
          return nroDeCuenta;
      }

      /**
       * @param nroDeCuenta the nroDeCuenta to set
       */
      public void setNroDeCuenta(javax.swing.JTextField nroDeCuenta) {
          this.nroDeCuenta = nroDeCuenta;
      }

      /**
       * @return the nroSucursal
       */
      public javax.swing.JTextField getNroSucursal() {
          return nroSucursal;
      }

      /**
       * @param nroSucursal the nroSucursal to set
       */
      public void setNroSucursal(javax.swing.JTextField nroSucursal) {
          this.nroSucursal = nroSucursal;
      }

      /**
       * @return the tablaConceptos
       */
      public javax.swing.JTable getTablaConceptos() {
          return tablaConceptos;
      }

      /**
       * @param tablaConceptos the tablaConceptos to set
       */
      public void setTablaConceptos(javax.swing.JTable tablaConceptos) {
          this.tablaConceptos = tablaConceptos;
      }

      /**
       * @return the tablaDatosBancarios
       */
    /*  public javax.swing.JTable getTablaDatosBancarios() {
          return tablaDatosBancarios;
      }*/
      
      /**
       * @return the tablaNroDeCuenta
       */
     /* public javax.swing.JTable getTablaNroDeCuenta() {
          return tablaNroDeCuenta;
      }*/

      /**
       * @param tablaDatosBancarios the tablaDatosBancarios to set
       */
   /*   public void setTablaDatosBancarios(javax.swing.JTable tablaDatosBancarios) {
          this.tablaDatosBancarios = tablaDatosBancarios;
      }*/
    
    /**
     * @return the calendario
     */
    public org.freixas.jcalendar.JCalendarCombo getCalendario() {
        return calendario;
    }
     
    public Date getDate() {
        return calendario.getDate();
    } 

    /**
     * @param calendario the calendario to set
     */
    public void setCalendario(org.freixas.jcalendar.JCalendarCombo calendario) {
        this.calendario = calendario; 
    }
    
    public void setCategorias(java.util.Vector categorias){
    	CategoriaDTO cat=new CategoriaDTO(); 
    	while (!categorias.isEmpty()){
    		cat=(CategoriaDTO) categorias.get(0);
    		categoria.addItem(cat.getNombre());
    		categorias.remove(0);
    	}
    	
    }
    
    public void setConceptos(java.util.Vector conceptos){
    	ConceptoDTO con=new ConceptoDTO(); 
    	while (!conceptos.isEmpty()){
    		con=(ConceptoDTO) conceptos.get(0);
    		conbConceptos.addItem(con.getDescripcion());  		
    		conceptos.remove(0);
    	}
    	
    }
    
    public Vector<ConceptoDTO> eliminarRepetidos(Vector<ConceptoDTO> conceptos){
    	Vector<ConceptoDTO> vector=new Vector<ConceptoDTO>();
    	vector.add((ConceptoDTO) conceptos.get(0));
    	conceptos.remove(0);
    	while (!conceptos.isEmpty()){
    		int i=0;
    
    		while( (i<vector.size())&&(!conceptos.isEmpty())&&(!(vector.get(i).getDescripcion().equals((Object)conceptos.get(0).getDescripcion())))){
    			i++;
    			
    		}
    		if (i>=vector.size()){
    			i--;
    		}
    		if (vector.get(i).getDescripcion().equals((Object)conceptos.get(0).getDescripcion())){
    			
    		}else{
    			vector.add(conceptos.get(0));
    		}
    		conceptos.remove(0);
    	}
    	return vector;    	
    }
    
	
 	public void insertarFila(){
		String[] filavacia=new String[5];
		DefaultTableModel m=(DefaultTableModel)tablaConceptos.getModel();
		m.addRow(filavacia);
		tablaConceptos.setModel(m);

	}
 	
	/*public void insertarFilaDatosBancarios(){
		String[] filavacia=new String[5];
		DefaultTableModel m=(DefaultTableModel)tablaDatosBancarios.getModel();
		m.addRow(filavacia);
		tablaDatosBancarios.setModel(m);

	}*/
	
	/*public void insertarFilaNumeroDeCuenta(){
		String[] filavacia=new String[1];
		DefaultTableModel m=(DefaultTableModel)tablaNroDeCuenta.getModel();
		m.addRow(filavacia);
		tablaNroDeCuenta.setModel(m);

	}*/
 	
 	public Vector<Concepto> getTablaConcep(){
 		int i=0;
 		String descripcion; 
 		Double importe;
 		Double porcentaje;
 		String remunerativo;
 		String tipo;
 		Vector<Concepto> vector = new Vector<Concepto>(); 
 	    while (i<tablaConceptos.getRowCount()){
 	    	descripcion=(String) tablaConceptos.getValueAt(i,0);
 	    	importe=(Double) tablaConceptos.getValueAt(i, 1);
 	    	porcentaje=(Double) tablaConceptos.getValueAt(i, 2); 
 	    	remunerativo=(String) tablaConceptos.getValueAt(i, 3);
 	    	tipo=(String) tablaConceptos.getValueAt(i, 4);
 	    	Concepto con=new Concepto();
 	    	con.setDescripcion(descripcion);
 	    	con.setImporte(importe);
 	    	con.setPorcentaje(porcentaje);
 	    	con.setRemunerativo(remunerativo);
 	    	con.setTipo(tipo);
 	    	vector.add(con);
 	    	i++;
 	    }
 	    return vector;
 		
 	}
 	
 	 public boolean existeConcepto(Vector<Concepto> con, String descripcion){
 		 boolean existe=false;
 		 while ((!con.isEmpty())&&(!(con.get(0).getDescripcion().equalsIgnoreCase(descripcion)))){
 			 con.remove(0);
 		 }
 		 if (con.isEmpty()){
 			 existe=false;
 		 }
 		 else{
 			 existe=true;
 		 }
 		 return existe;
 	 }
 	
 	/*public Vector<CuentaBanco> getTablaCuenta(Vector<SucursalBanco> sucursal){
 		int i=0;
 		String nroDeCuenta;
 	//	String nroSucursal;
 		//String Banco;
 		Vector<CuentaBanco> vector = new Vector<CuentaBanco>(); 
 	    while (i<tablaDatosBancarios.getRowCount()){
 	    	nroDeCuenta=(String) tablaDatosBancarios.getValueAt(i,0);
 	    	//nroSucursal=(String) tablaDatosBancarios.getValueAt(i, 1);
 	    	//Banco=(String) tablaDatosBancarios.getValueAt(i, 2); 
 	    	CuentaBanco cuen=new CuentaBanco();
 	    	cuen.setNro(nroDeCuenta);	
 	    	cuen.setSucursal(sucursal.get(0));
 	    	vector.add(cuen);
 	    	sucursal.remove(0);
 	    	i++;
 	    }
 	    return vector; 
 		
 	}
 	
	public Vector<SucursalBanco> getTablaSucursal(){
 		int i=0;
 		//int nroDeCuenta;
 		String nroSucursal;
 		String Banco;
 		Vector<SucursalBanco> vector = new Vector<SucursalBanco>(); 
 	    while (i<tablaDatosBancarios.getRowCount()){
 	    	//nroDeCuenta= () tablaDatosBancarios.getValueAt(i,0);
 	    	nroSucursal=(String) tablaDatosBancarios.getValueAt(i, 1);
 	    	//Banco=(String) tablaDatosBancarios.getValueAt(i, 2); 
 	    	SucursalBanco sucu=new SucursalBanco();
 	    	sucu.setNro(nroSucursal);
 	    	vector.add(sucu);
 	    	i++;
 	    }
 	    
 	    return vector; 
 		
 	}
	
	public Vector<SucursalBanco> getTablaSucursal(Vector<Banco> banco){
 		int i=0;
 		//int nroDeCuenta;
 		String nroSucursal;
 		String Banco;
 		Vector<SucursalBanco> vector = new Vector<SucursalBanco>(); 
 	    while (i<tablaDatosBancarios.getRowCount()){
 	    	//nroDeCuenta= () tablaDatosBancarios.getValueAt(i,0);
 	    	nroSucursal=(String) tablaDatosBancarios.getValueAt(i, 1);
 	    	//Banco=(String) tablaDatosBancarios.getValueAt(i, 2); 
 	    	SucursalBanco sucu=new SucursalBanco();
 	    	sucu.setNro(nroSucursal);
 	    	sucu.setBanco(banco.get(0));
 	    	vector.add(sucu);
 	    	banco.remove(0);
 	    	i++;
 	    }
 	    
 	    return vector; 
 		
 	}
	
	
	public Vector<Banco> getTablaBanco(){
 		int i=0;
 		//int nroDeCuenta;
 		//int nroSucursal;
 		String banco;
 		Vector<Banco> vector = new Vector<Banco>(); 
 	    while (i<tablaDatosBancarios.getRowCount()){
 	    	//nroDeCuenta= () tablaDatosBancarios.getValueAt(i,0);
 	    	//nroSucursal=(Integer) tablaDatosBancarios.getValueAt(i, 1);
 	    	banco=(String) tablaDatosBancarios.getValueAt(i, 2); 
 	    	if (vector.contains((Object) banco)){
 	    		System.out.println("entre");
 	    	}else{
 	    	Banco banc=new Banco();
 	    	banc.setNombre(banco);
 	    	//banc.setSucursales(sucursal);
 	    	vector.add(banc);
 	    	}
 	    	i++;
 	    }
 	   //banc.setSucursales(sucursal);
 	    return vector; 
 		
 	}*/
 	
 	public void setTablaConcepto(int fila){
		int i=tablaConceptos.getRowCount()-1;
		while (fila<i){			
			tablaConceptos.setValueAt(tablaConceptos.getValueAt(fila+1,0), fila, 0);
			tablaConceptos.setValueAt(tablaConceptos.getValueAt(fila+1,1), fila, 1);
			tablaConceptos.setValueAt(tablaConceptos.getValueAt(fila+1,2), fila, 2);	
			tablaConceptos.setValueAt(tablaConceptos.getValueAt(fila+1,3), fila, 3);
			tablaConceptos.setValueAt(tablaConceptos.getValueAt(fila+1,4), fila, 4);
			fila++;			
		}
		DefaultTableModel m=(DefaultTableModel)tablaConceptos.getModel();
		m.removeRow(i);
	}
    
    public void setActionListeners(ActionListener lis) {
        aceptar.addActionListener(lis);
        cancelar.addActionListener(lis);
        categoria.addActionListener(lis);
        agregarConcepto.addActionListener(lis);
        eliminar.addActionListener(lis);
        
    }
}
